package com.test.dazuoye.dao;

import com.test.dazuoye.domain.YongHu;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @date 2020/6/4-10:14
 */
@Mapper
@Repository
public interface YongHuDao {

    //查询用户
    @Select("select * from yonghu")
    public List<YongHu> findAll();

    //查询一个
    @Select("select * from yonghu where uname=#{uname}")
    public YongHu findOne(String uname);


    //删除用户
    @Delete("delete from yonghu where uname=#{uname}")
    public void deleteYongHu(String uname);

    //保存用户
    @Insert("insert into yonghu(uname,upassword,shenfen) values (#{uname},#{upassword},#{shenfen})")
    public void saveYongHu(YongHu yongHu);

}
